package com.naiterui.ehp.bs.doctor.fegin;

import java.util.List;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.*;

import com.naiterui.common.repository.page.PageVO;
import com.naiterui.ehp.bp.bo.im.*;
import com.naiterui.ehp.bp.support.config.FeignConfiguration;
import com.naiterui.ehp.bp.support.exception.BusinessException;

/**
 * @author gaoliangliang
 * @date 2019-11-29 20:39:30
 * @since 1.0.0
 */
@FeignClient(name = "adIm", url = "${ehp.domain.im}", configuration = FeignConfiguration.class)
public interface ImFeginClient {

    @RequestMapping(value = "/inner/session/list")
    PageVO<SessionDetailBO> sessionList(@RequestBody SessionParamBO sessionParam) throws BusinessException;

    /**
     * 发送服务评价
     *
     * @param message
     * @throws BusinessException
     */
    @Async
    @PostMapping("inner/serviceEvaluation/send")
    void sendServiceEvaluation(@RequestBody String message) throws BusinessException;

    /**
     * @param msgSendParamBO
     * @return
     * @throws BusinessException
     */
    @PostMapping("inner/message/send")
    PatientMsgSendBO wxMessageSend(PatientMsgSendParamBO msgSendParamBO) throws BusinessException;

    /**
     * 向患者发送系统消息
     *
     * @param msgSendParamBO
     * @return
     * @throws BusinessException
     */
    @PostMapping("inner/patient/sys/message/send")
    void sendPatientSysMessage(PatientMsgSendParamBO msgSendParamBO) throws BusinessException;

    /**
     * 结束会话
     *
     * @param doctorId
     * @param patientId
     * @param triggerSource
     * @throws BusinessException
     */
    @PostMapping("inner/session/finish")
    void finishSession(@RequestParam("doctorId") Long doctorId, @RequestParam("patientId") Long patientId,
                       @RequestParam("triggerSource") Integer triggerSource) throws BusinessException;

    /**
     * 随访卡片
     *
     * @param followUpImMsg
     * @return
     * @throws BusinessException
     */
    @PostMapping("/inner/followup")
    void sendFollowUp(@RequestBody FollowUpImMsgBO followUpImMsg) throws BusinessException;

    @GetMapping("inner/session/detail/list")
    List<SessionDetailBO> sessionDetailList(@RequestParam("sessionIds") String sessionIds);
}
